﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WaterRevenueMS.Domain.Common.Models;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace WaterRevenueMS.Domain.ViewModels.Maintenance.MeterTask
{
    public class MeterTaskModel : EntityCommon 
    {
        public MeterTaskModel()
        {
            Cao_ZLXItems = new List<SelectListItem>() {
                new SelectListItem { Text = "--- 操作类型 ---", Value = "-1"}, 
                new SelectListItem { Text = "正常", Value = "0" },
                new SelectListItem { Text = "报停", Value = "1" },
                new SelectListItem { Text = "报修", Value = "2" },
                new SelectListItem { Text = "复装", Value = "3" },
                new SelectListItem { Text = "换表", Value = "4" },
                new SelectListItem { Text = "拆表", Value = "5" }
               };

            Shui_BKJItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择水表口径类型",Value="-1"}
            };
            Shui_BCSItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择水表厂商",Value="-1"}
            };
            Search = new SearchModel();
            {

            };
        }

         public int Id { get; set; }

        [Display(Name = "备注")]
        public string Bei_Z { get; set; }

        public int Meter_No { get; set; }
        public string Liu_SH { get; set; }
        public int? Cao_ZLX { get; set; }
        public string Cao_ZY { get; set; }

        public string Cao_ZYY { get; set; }
        public string New_SBDZ { get; set; }

        public bool Chu_LZT { get; set; }

        public DateTime? CreateDT { get; set; }

        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Display(Name = "仪表地址")]
        public string Yi_BDZ { get; set; }

        [Display(Name = "口径")]
        public int? Shui_BKJ_No { get; set; }
        [Display(Name = "口径名称")]
        public List<SelectListItem> Shui_BKJItems { get; set; }

        [Display(Name = "安装位置")]
        public string AN_ZWZ { get; set; }

        [Display(Name = "水表厂商代码")]
        public int? Shui_BCS_No { get; set; }
        [Display(Name = "水表厂商")]
        public List<SelectListItem> Shui_BCSItems { get; set; }

        [Display(Name = "读数本次")]
        public float Du_SBC { get; set; }


        [Display(Name = "操作类型")]
        public List<SelectListItem>Cao_ZLXItems { get; set; }


        public string CaoZLX
        {
            get
            {
                if (Cao_ZLX == 0)
                {
                    return "正常";
                }
                else
                {
                    if (Cao_ZLX == 1)
                    {
                        return "报停";
                    }
                    else
                    {
                        if (Cao_ZLX == 2)
                        {
                            return "报修";
                        }
                        else
                        {

                            if (Cao_ZLX == 3)
                            {
                                return "复装";
                            }
                            else
                            {
                                if (Cao_ZLX == 4)
                                {
                                    return "换表";
                                }
                                else
                                {

                                    if (Cao_ZLX == 5)
                                    {
                                        return "拆表";
                                    }
                                    else
                                    {

                                        return "其它";

                                    }

                                }

                            }

                        }

                    }
                    // return "";
                }

            }
            set { }
        }

        public SearchModel Search { get; set; }

    }
    public class SearchModel
    {
        public SearchModel()
        {
            Cao_ZLXItems = new List<SelectListItem>() {
                new SelectListItem { Text = "--- 操作类型 ---", Value = "-1"}, 
                new SelectListItem { Text = "正常", Value = "0" },
                new SelectListItem { Text = "报停", Value = "1" },
                new SelectListItem { Text = "报修", Value = "2" },
                new SelectListItem { Text = "复装", Value = "3" },
                new SelectListItem { Text = "换表", Value = "4" },
                new SelectListItem { Text = "拆表", Value = "5" }
               };

            Chu_LZTItems = new List<SelectListItem>() {
                new SelectListItem { Text = "--- 处理状态 ---", Value = "abcd"}, 
                new SelectListItem { Text = "已处理", Value = "true" },
                new SelectListItem { Text = "未处理", Value = "false" }
               };          
        }


        [Display(Name = "备注状态")]
        public string Bei_Z { get; set; }

        public int? Meter_No { get; set; }
        public string Liu_SH { get; set; }
        public string Cao_ZLX { get; set; }
        public string Cao_ZY { get; set; }
        public bool Chu_LZT { get; set; }
        [Display(Name = "处理状态")]
        public List<SelectListItem> Chu_LZTItems { get; set; }

        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Display(Name = "仪表地址")]
        public string Yi_BDZ { get; set; }

        [Display(Name = "操作类型")]
        public List<SelectListItem> Cao_ZLXItems { get; set; }
        public int? CaoZLX { get; set; }

        public string Cao_ZYY { get; set; }
        public string New_SBDZ { get; set; }

    }
}
